let App = getApp();
const siteroot = require('../../../siteinfo')

Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: [ {
      title:'这是帮助的标题',
      content:'这是帮助的内容'
    }],
   
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.GetKefuInfo()
  },
  GetKefuInfo(){
    let _this = this
    App._get('GetKefuInfo',{},(res)=>{
      console.log(res)
      res.img = siteroot.siteroot+res.KeFuQRCode
      _this.setData({
        detail:res
      })
    })
  },
  zixun(){
    let _this = this
    wx.showModal({
      title:'是否要拨打电话咨询',
      cancelText:'取消',
      confirmText:'确定拨打',
      confirmColor:'green',
      success:(res)=>{
        if (res.confirm) {
          wx.makePhoneCall({
            phoneNumber: _this.data.detail.KeFuTel,
          })
        } else if (res.cancel) {
          console.log('用户点击取消')
        }
      }
    })
  },
})